package com.itheima.reggie.common;

import com.itheima.reggie.domain.Category;

/**
 * @author zsk
 * @create 2022-02-14-13:08
 */
public class CategoryHolder {
    //维护ThreadLocal对象
    private static ThreadLocal<Category> threadLocal = new ThreadLocal<>();

    //放入User
    public static void set(Category Category) {
        threadLocal.set(Category);
    }

    //获取User
    public static Category get() {
        return threadLocal.get();
    }

    //移除User
    public static void remove() {
        threadLocal.remove();
    }
}
